/*!
 * Ext JS Library 3.3.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.onReady(function(){
    Ext.QuickTips.init();

    // simple array store
    var store = new Ext.data.ArrayStore({
        fields: ['abbr', 'state', 'nick'],
        data : Ext.exampledata.states // from states.js
    });

    var combo = new Ext.form.ComboBox({
        store: store,
        displayField:'state',
        typeAhead: true,
        mode: 'local',
        forceSelection: true,
        triggerAction: 'all',
        emptyText:'Select a state...',
        selectOnFocus:true,
        applyTo: 'local-states'
    });
    

    var simple = new Ext.FormPanel({
        labelWidth: 40, // label settings here cascade unless overridden
        frame: true,
        title: 'Simple Form',
        bodyStyle: 'padding:5px 5px 0',
        width: 600,
				height:500,
        defaults: {width: 135},
        defaultType: 'textfield',

        items: [
            new Ext.ux.form.SpinnerField({
                fieldLabel: 'Age',
                name: 'age'
            }),
            {
            	xtype: 'spinnerfield',
            	fieldLabel: 'Test',
            	name: 'test',
            	minValue: 0,
            	maxValue: 100,
            	allowDecimals: true,
            	decimalPrecision: 1,
            	incrementValue: 0.4,
            	alternateIncrementValue: 2.1,
            	accelerate: true
            },
		        {
		            xtype: 'grid',
		            height: 191,
		            columns: [
		                {
		                    xtype: 'gridcolumn',
		                    dataIndex: 'string',
		                    header: 'Column',
		                    sortable: true,
		                    width: 100
		                },
		                {
		                    xtype: 'numbercolumn',
		                    dataIndex: 'number',
		                    header: 'Column',
		                    sortable: true,
		                    width: 100,
		                    align: 'right'
		                },
		                {
		                    xtype: 'datecolumn',
		                    dataIndex: 'date',
		                    header: 'Column',
		                    sortable: true,
		                    width: 100
		                },
		                {
		                    xtype: 'booleancolumn',
		                    dataIndex: 'bool',
		                    header: 'Column',
		                    sortable: true,
		                    width: 100
		                }
		            ]
		        }
        ]
    });

    simple.render('form-ct');

});